# coding: utf-8
import unittest
import uiautomator2 as u2
import time
import uiautomator2.ext.htmlreport as htmlreport

class TestCloudMusic(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.u = u2.connect('192.168.2.243:5555')
        cls.u.healthcheck()
        hrp = htmlreport.HTMLReport(cls.u, 'report')
        hrp.patch_click()

        # cls.u.disable_popups(True)  # 允许自动处理弹出框
        cls.u.toast.show("测试开始", 3)

    @classmethod
    def tearDownClass(cls):
        cls.u.toast.show("测试结束", 3)
        cls.u.app_stop_all()
        cls.u.uiautomator.stop()  # 停止uiautomator守护程序，允许其他测试框架如 appium 运行

    def setUp(self):
        print('qidonmg ')

        time.sleep(5)

    def tearDown(self):
        pass

    def testPrivateFM(self):
        self.d = self.u.session()
        self.d(text="千牛").click()
        self.d(text="卖家中心").click()
        self.d(text="订单提醒").click()
        self.d(text="待发货订单").click()

if __name__ == '__main__':
    unittest.main()